package liuliu.throughwaring.view;

/**
 * 检测文本框清空情况
 * Created by Administrator on 2016/1/22.
 */
public class Util {
    public static String checkEmpty(String val) {
        if (val == null) {
            val = "";
        }
        return checkEmpty(val, "");
    }

    public static String checkEmpty(String val, String defval) {
        String result = "";
        if (null == val||("").equals(val)) {
            if (!defval.equals("")) {
                result = defval;
            } else {
                result = "无";
            }
        } else {
            result = val;
        }
        return result;
    }
}
